UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rE7JJKxjR0/efCvJPbYKfsIIJiYiVlmzX23fxtfs8Y='
WHERE
key_id = '5b18ee5e19827c1e9bf195ad17ab7d7efffcfe881168bbff054b4bd0c4fcf736'
AND (
token = '5rE7JJKxjR0/efCvJPbYKfsIIJiYiVlmzX23fxtfs8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)