UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7WGvbSb0/fZ2Pr0n9GZPHZ6XoKK1x9ScN6wL6YVAKWo=' 
WHERE 
  key_id = 'a810c1e27ad893eddf9ed0bc9577d46156189a8289a81b22868d39de4800869e' 
  AND (
    token = '7WGvbSb0/fZ2Pr0n9GZPHZ6XoKK1x9ScN6wL6YVAKWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030