UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U3s+k0Hkc9P1IP32ZW/5ZzbOnBMZB8LxPjDl/Dicmn4=' 
WHERE 
  key_id = 'a30570fdadbc8de30760d8a6b071a16dfeaca82414b30f88b1b5bbedf09b2974' 
  AND (
    token = 'U3s+k0Hkc9P1IP32ZW/5ZzbOnBMZB8LxPjDl/Dicmn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027