UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c7bPeZb7erEH662eoMGjRp/mdMGiCfEUXhpugL7DJtg='
WHERE
key_id = '29a73bbe21c13ee8ce48745dc54f8b3a6a41a6a8a07afc2dbca4258a641b05ba'
AND (
token = 'c7bPeZb7erEH662eoMGjRp/mdMGiCfEUXhpugL7DJtg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)