UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'APHA8WltlPDEenRvkouEc3KoMYJcPyZ2XjXUeM7583c='
WHERE
key_id = 'e123773112bf67f7b35ff239becd2c42397a97baa6168c52e9aad7362989f609'
AND (
token = 'APHA8WltlPDEenRvkouEc3KoMYJcPyZ2XjXUeM7583c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)