UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MhZoFXLwpLE3VHQPsdgEoVkgN7OyMttCov0u4PAVxrA='
WHERE
key_id = '0c0c33c3e29b540539236668949dbd6953eb6883f70d0f537a416640081bb7e9'
AND (
token = 'MhZoFXLwpLE3VHQPsdgEoVkgN7OyMttCov0u4PAVxrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)