UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FR2/9bt6VTX9lhc8gKEH8TvWaU5QlJ/+iQkzkfFV14o=' 
WHERE 
  key_id = '96324ac1ba39c96f1143bd8f4c48d2e92a07bb415badc95a09b7ec40569cb8e6' 
  AND (
    token = 'FR2/9bt6VTX9lhc8gKEH8TvWaU5QlJ/+iQkzkfFV14o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037