UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDfVOEpcjd48tTAb6kmvN6tnOeACDz/DS95z70RWmCo='
WHERE
key_id = '66bdccbf26561ce950a93656e6f0812c5a237231ee79c4a1bff2f6ef1aee9dd4'
AND (
token = 'iDfVOEpcjd48tTAb6kmvN6tnOeACDz/DS95z70RWmCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)