UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TF70T/V6v2ahB9KoOKnsXlbSL+pfGTTPoXj6o5jo8u4='
WHERE
key_id = '3e177bd81d8a0ee8253feecbfbcc042060ff2c1c613be4c95360ddba708d5211'
AND (
token = 'TF70T/V6v2ahB9KoOKnsXlbSL+pfGTTPoXj6o5jo8u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)