UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xk5LrsejQn6Vh00vE8yHTml603e8oYO1yNQtXQLC9tc='
WHERE
key_id = '6e912f4e4c78a2bb488878980c8053f07916d070234c03287070a67dd5f116ba'
AND (
token = 'Xk5LrsejQn6Vh00vE8yHTml603e8oYO1yNQtXQLC9tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)