UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Me267cnQBZYPpI+LxPAFGR/aYRb1i+lshqxLofJtEE=' 
WHERE 
  key_id = 'f86378439d257288f7b4fbe05684d8a3bd48c6fb03c4f58969af69fc4479c3a7' 
  AND (
    token = '9Me267cnQBZYPpI+LxPAFGR/aYRb1i+lshqxLofJtEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030