UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ArmSU7D0rRK4ehPKmUdi23FyLQ1zZVXTf5TOYBxDTI='
WHERE
key_id = 'f25d0753a5f4434f6e526d9d4f65250416f166e3f72182e68659f474e5343ccd'
AND (
token = '3ArmSU7D0rRK4ehPKmUdi23FyLQ1zZVXTf5TOYBxDTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)