UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7PBybj9Dq/1l+e11tUmyA5FjbBWX9CL18svIBJBgwQE=' 
WHERE 
  key_id = 'c24b5da5cff19afbe0b69294e0a389c565266891f1e4847f27fab8567568219b' 
  AND (
    token = '7PBybj9Dq/1l+e11tUmyA5FjbBWX9CL18svIBJBgwQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021