UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJzABKKDwq6XaF2Kg7Y4LM19iDX0xfqSv73u5EGmlyA='
WHERE
key_id = '7e2ad1288e40f8ef9554bfc294764fcd011ef806f5a7ab8fe53adb29bee0f17d'
AND (
token = 'cJzABKKDwq6XaF2Kg7Y4LM19iDX0xfqSv73u5EGmlyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)