UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KVXAMb/3Sc9IpVKlnzK9uGh/Y4Mn8v5pxK3s8zs7FPs='
WHERE
key_id = 'f33e2b6344db1c88ce7b882da62863ea596395e8f644ff5cbf4ccb505ba900f4'
AND (
token = 'KVXAMb/3Sc9IpVKlnzK9uGh/Y4Mn8v5pxK3s8zs7FPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)