UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+FW+yunsfXN4vKxPof/hihDhf7BlUfHs60snYA1HGvE=' 
WHERE 
  key_id = '4f7848643c6ae8be7482434c3691dc8e18b7449d08c2cb1ce721139d8ecaf676' 
  AND (
    token = '+FW+yunsfXN4vKxPof/hihDhf7BlUfHs60snYA1HGvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076