UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oqicu+rG0xna2LWbgRrEXLD/7cdpz/PpdHvKQLt3Gic=' 
WHERE 
  key_id = 'ba7dd529c030e58f37276ed05bd6c7880ecdcb8c0a0e2f46ca20a0b7b18062b3' 
  AND (
    token = 'Oqicu+rG0xna2LWbgRrEXLD/7cdpz/PpdHvKQLt3Gic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038