UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+CfjgTRcXkzkWmCuqd/JJntOmpXgc8S6j6OLcpXge88=' 
WHERE 
  key_id = '696731a6da1e6734a78441d3d01f194b634611d67c267cf4c95358fd638c92e1' 
  AND (
    token = '+CfjgTRcXkzkWmCuqd/JJntOmpXgc8S6j6OLcpXge88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030