UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/t6IGOfeJdTQxPmoRfvsVM5L5UbNhnghOxEKOcnw9q8='
WHERE
key_id = '1b41724f8ce093e16959a4680d2febbc6b7756e52e77778daadf7b58d21a47d6'
AND (
token = '/t6IGOfeJdTQxPmoRfvsVM5L5UbNhnghOxEKOcnw9q8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)