UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iSGE4ZdsK1qcAohUSRCVJiw1bV72hVsry1zGUrFb7r4='
WHERE
key_id = '06f164ee944c053ed9f5fe36566f19a7fde16dc1da3fd217bd6b59fa3849d8d5'
AND (
token = 'iSGE4ZdsK1qcAohUSRCVJiw1bV72hVsry1zGUrFb7r4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)