UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xsg505aEzBRxyRz7Wo6qELq0/jjaZs6q8IyfTgZCn4g='
WHERE
key_id = '8623590425f851fd267e650f80f80eedfee2a7d93c9dda2eab00654ad4f1b734'
AND (
token = 'Xsg505aEzBRxyRz7Wo6qELq0/jjaZs6q8IyfTgZCn4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)