UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QTJMLbJ6KbKyTMzoPjN9Gj7p4aCFTFt/NmFTz9KTMkQ=' 
WHERE 
  key_id = '622f1b827226972d1269a83a1913e06dc7d493d7985c54973b4ea216e36b71bc' 
  AND (
    token = 'QTJMLbJ6KbKyTMzoPjN9Gj7p4aCFTFt/NmFTz9KTMkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037