UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LI9cbJEOOZUnut9shiMm8ztmm0uaGwezhMzm2I5t9Ms=' 
WHERE 
  key_id = '47b006934bb0e957899da5e081467580daf9a0318b4581b2a1bb3fcbc212bb91' 
  AND (
    token = 'LI9cbJEOOZUnut9shiMm8ztmm0uaGwezhMzm2I5t9Ms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021