UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VX136qXk120R5IUKkWy9k8sSwOamxnOjqo3HO++6X2k='
WHERE
key_id = '18f86b357330edccee3bd7b3c3751e5135cb01dccca5ed2d88a6875759525155'
AND (
token = 'VX136qXk120R5IUKkWy9k8sSwOamxnOjqo3HO++6X2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)