UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Lit/pV1CPTuzcWH8kkGEkiKgZVVk7SLBlOyl4SkyiI=' 
WHERE 
  key_id = '39821497f300c384f76299c672aa61095f5b05c6432ca07c64276a55835343e1' 
  AND (
    token = '4Lit/pV1CPTuzcWH8kkGEkiKgZVVk7SLBlOyl4SkyiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029