UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITvV+Feuzw5WwRsDCqpZrZoy9eplYWZkn7eIXYpRLR8='
WHERE
key_id = 'ee0502089d25f9b627b165aaa600c9d0c8331d124b3550f67b32d59c0d76459d'
AND (
token = 'ITvV+Feuzw5WwRsDCqpZrZoy9eplYWZkn7eIXYpRLR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)