UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpQ9aDQZ89ejaMUQbOh9YCFZDoQURGU8w21irPz3ZQ8='
WHERE
key_id = '2bf5e1c866e29bd8c2aabdb8f19f0919d94091217b43853c2dfd9c2d88c93e80'
AND (
token = 'xpQ9aDQZ89ejaMUQbOh9YCFZDoQURGU8w21irPz3ZQ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)