UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DQzZ9f6eWv9wBeP8X4xiDGJS9C+xeDdLrWll11oDRP4='
WHERE
key_id = '154cf9d58fbe5c46e721f5c6f8aefb86fa41a560afae07f321d9f9a432d2f7fa'
AND (
token = 'DQzZ9f6eWv9wBeP8X4xiDGJS9C+xeDdLrWll11oDRP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)