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