UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EetA6GMvQEe7IwR5GoQhHoacLjRPOZqxEQJGzov1uHc=' 
WHERE 
  key_id = '760ad72a4b185e51a6a37c05b764fb771dc674d9503fb0b362d24f155ab3935e' 
  AND (
    token = 'EetA6GMvQEe7IwR5GoQhHoacLjRPOZqxEQJGzov1uHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019