UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mcTR+p6hQu7qPAukmFMX8ms1RqvUD7DDsUYlfeiJcDA='
WHERE
key_id = '68eb6df866fa40549ea1cc0dfc71929b1b4ff936e90f49a47711735e1b8dc530'
AND (
token = 'mcTR+p6hQu7qPAukmFMX8ms1RqvUD7DDsUYlfeiJcDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)