UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWPY5VvocEDAk8nKjx2BuWv0/I4yOWyO0WcnQIoQnAo='
WHERE
key_id = '64099b1f0fdf953aaa36221d0d86546cc3fa9066d2b2dd41a42dab2ddae49978'
AND (
token = 'jWPY5VvocEDAk8nKjx2BuWv0/I4yOWyO0WcnQIoQnAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)